<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QErrorMessage Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QErrorMessage Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QErrorMessage class provides an error message display dialog. <a href="#details">More...</a></p>
<p>Inherits <a href="qdialog.html">QDialog</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qerrormessage.html#QErrorMessage">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qerrormessage.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qerrormessage.html#done">done</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qerrormessage.html#showMessage">showMessage</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qerrormessage.html#showMessage-2">showMessage</a></b> (<i>self</i>, QString, QString)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QErrorMessage <b><a href="qerrormessage.html#qtHandler">qtHandler</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QErrorMessage class provides an error message display dialog.</p>
<p>An error message widget consists of a text label and a checkbox. The checkbox lets the user control whether the same error message will be displayed again in the future, typically displaying the text, "Show this message again" translated into the appropriate local language.</p>
<p>For production applications, the class can be used to display messages which the user only needs to see once. To use QErrorMessage like this, you create the dialog in the usual way, and show it by calling the <a href="qerrormessage.html#showMessage">showMessage</a>() slot or connecting signals to it.</p>
<p>The static <a href="qerrormessage.html#qtHandler">qtHandler</a>() function installs a message handler using <a href="qtcore.html#qInstallMsgHandler">qInstallMsgHandler</a>() and creates a QErrorMessage that displays <a href="qtcore.html#qDebug">qDebug</a>(), <a href="qtcore.html#qWarning">qWarning</a>() and <a href="qtcore.html#qFatal">qFatal</a>() messages. This is most useful in environments where no console is available to display warnings and error messages.</p>
<p>In both cases QErrorMessage will queue pending messages and display them in order, with each new message being shown as soon as the user has accepted the previous message. Once the user has specified that a message is not to be shown again it is automatically skipped, and the dialog will show the next appropriate message in the queue.</p>
<p>The <a href="dialogs-standarddialogs.html">Standard Dialogs</a> example shows how to use QErrorMessage as well as other built-in Qt dialogs.</p>
<p align="center"><img src="images/qerrormessage.png" /></p><p>See also <a href="qmessagebox.html">QMessageBox</a>, <a href="qstatusbar.html#showMessage">QStatusBar.showMessage</a>(), and <a href="dialogs-standarddialogs.html">Standard Dialogs Example</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QErrorMessage" />QErrorMessage.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs and installs an error handler window with the given <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QErrorMessage/~QErrorMessage" />
<h3 class="fn"><a name="changeEvent" />QErrorMessage.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QErrorMessage/done" />
<h3 class="fn"><a name="done" />QErrorMessage.done (<i>self</i>, int)</h3><p>Reimplemented from <a href="qdialog.html#done">QDialog.done</a>().</p>
<a name="//apple_ref/cpp/clm/QErrorMessage/qtHandler" />
<h3 class="fn"><a name="qtHandler" /><a href="qerrormessage.html">QErrorMessage</a> QErrorMessage.qtHandler ()</h3><p>Returns a pointer to a <a href="qerrormessage.html">QErrorMessage</a> object that outputs the default Qt messages. This function creates such an object, if there isn't one already.</p>
<a name="//apple_ref/cpp/instm/QErrorMessage/showMessage" />
<h3 class="fn"><a name="showMessage" />QErrorMessage.showMessage (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showMessage(const QString&amp;)</tt>.</p><p>Shows the given message, <i>message</i>, and returns immediately. If the user has requested for the message not to be shown again, this function does nothing.</p>
<p>Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.</p>
<h3 class="fn"><a name="showMessage-2" />QErrorMessage.showMessage (<i>self</i>, QString, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showMessage(const QString&amp;,const QString&amp;)</tt>.</p><p>This is an overloaded function.</p>
<p>Shows the given message, <i>message</i>, and returns immediately. If the user has requested for messages of type, <i>type</i>, not to be shown again, this function does nothing.</p>
<p>Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qerrormessage.html#showMessage">showMessage</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.7.1-5014f7c72a58 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.1</td></tr></table></div></address></body></html>